package com.bamanker.dailylove.service;

import com.bamanker.dailylove.domain.ResultVo;
import com.bamanker.dailylove.domain.WechatTokenParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "WechatRequestClient", url = "https://api.weixin.qq.com/cgi-bin")
public interface WechatRequestClient {

    @GetMapping("/token")
    String getAccessToken(@SpringQueryMap WechatTokenParam param);

    @PostMapping("/message/template/send?access_token={token}")
    String sendMsg(ResultVo resultVo, @RequestParam("token") String token);
}
